<code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> should fixup URLs pointing to a directory or
not.</p>
<p>Typically if a user requests a resource without a trailing slash, which
points to a directory, <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> redirects him to the same
resource, but <em>with</em> trailing slash for some good reasons:</p>
<ul>
<li>The user is finally requesting the canonical URL of the resource</li>
<li><code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> works correctly. Since it doesn't emit
the path in the link, it would point to the wrong path.</li>
<li><code class="directive"><a href="#directoryindex">DirectoryIndex</a></code> will be evaluated
<em>only</em> for directories requested with trailing slash.</li>
<li>Relative URL references inside html pages will work correctly.</li>
</ul>
<p>Well, if you don't want this effect <em>and</em> the reasons above don't
apply to you, you can turn off the redirect with:</p>
<div class="example"><p><code>
# see security warning below!<br />
<Location /some/path><br />
<span class="indent">
DirectorySlash Off<br />
SetHandler some-handler<br />
</span>
</Location>
</code></p></div>
<div class="warning"><h3>Security Warning</h3>
<p>Turning off the trailing slash redirect may result in an information
disclosure. Consider a situation where <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> is
active (<code>Options +Indexes</code>) and <code class="directive"><a href="#directoryindex">DirectoryIndex</a></code> is set to a valid resource (say,
<code>index.html</code>) and there's no other special handler defined for
that URL. In this case a request with a trailing slash would show the
<code>index.html</code> file. <strong>But a request without trailing slash
would list the directory contents</strong>.</p>
</div>
</div>
</div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="../en/mod/mod_dir.html" title="English"> en </a> |
<a href="../ja/mod/mod_dir.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> |
<a href="../ko/mod/mod_dir.html" hreflang="ko" rel="alternate" title="Korean"> ko </a></p>
</div><div id="footer">
<p class="apache">Copyright 1995-2006 The Apache Software Foundation or its licensors, as applicable.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>